#!/usr/bin/env bash

cd `dirname $0`

if [ ! -d logs ]; then
  mkdir logs
fi

conf_file=conf/nginx.conf

# test conf file
# nginx  -p `pwd` -t -c $conf_file


# if already start, stop
if [ -f logs/nginx.pid ]; then
  echo "restart ... "
  ./shutdown.sh
fi

# start
nginx -p `pwd`/ -c $conf_file
